package cn.wind.xboot.logic.service.impl;

import cn.wind.xboot.logic.dto.BannerFeeDto;
import cn.wind.xboot.logic.entity.Banner;
import cn.wind.xboot.logic.dao.BannerMapper;
import cn.wind.xboot.logic.service.IBannerService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 轮播广告 服务实现类
 * </p>
 *
 * @author wind
 * @since 2018-12-21
 */
@Service
public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> implements IBannerService {

    @Override
    public List<Banner> findAll() {
        return this.baseMapper.selectAll();
    }

    @Override
    public IPage<Banner> findByCondition(IPage page, Map<String, Object> map) {
        return this.baseMapper.findByCondition(page,map);
    }

    @Override
    public List<BannerFeeDto> countTodayFee() {
        return this.baseMapper.countTodayFee();
    }

    @Override
    public List<BannerFeeDto> countWeekFee() {
        return this.baseMapper.countWeekFee();
    }

    @Override
    public List<BannerFeeDto> countMonthFee() {
        return this.baseMapper.countMonthFee();
    }

    @Override
    public List<BannerFeeDto> countYearFee() {
        return this.baseMapper.countYearFee();
    }

    @Override
    public int prohibitBanner(Integer id) {
        return this.baseMapper.updateStatusById(id);
    }
}
